package com.binest.draftBox.service.impl;

import java.util.List;
import com.binest.common.utils.DateUtils;
import com.binest.draftBox.domain.DraftBox;
import com.binest.draftBox.mapper.DraftBoxMapper;
import com.binest.draftBox.service.IDraftBoxService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 草稿箱Service业务层处理
 * 
 * @author wwd
 * @date 2024-01-04
 */
@Service
public class DraftBoxServiceImpl implements IDraftBoxService
{
    @Autowired
    private DraftBoxMapper draftBoxMapper;

    /**
     * 查询草稿箱
     * 
     * @param id 草稿箱主键
     * @return 草稿箱
     */
    @Override
    public DraftBox selectDraftBoxById(String id)
    {
        return draftBoxMapper.selectDraftBoxById(id);
    }

    /**
     * 查询草稿箱列表
     * 
     * @param draftBox 草稿箱
     * @return 草稿箱
     */
    @Override
    public List<DraftBox> selectDraftBoxList(DraftBox draftBox)
    {
        return draftBoxMapper.selectDraftBoxList(draftBox);
    }

    /**
     * 新增草稿箱
     * 
     * @param draftBox 草稿箱
     * @return 结果
     */
    @Override
    public int insertDraftBox(DraftBox draftBox)
    {
        draftBox.setCreateTime(DateUtils.getNowDate());
        return draftBoxMapper.insertDraftBox(draftBox);
    }

    /**
     * 修改草稿箱
     * 
     * @param draftBox 草稿箱
     * @return 结果
     */
    @Override
    public int updateDraftBox(DraftBox draftBox)
    {
        draftBox.setUpdateTime(DateUtils.getNowDate());
        return draftBoxMapper.updateDraftBox(draftBox);
    }

    /**
     * 批量删除草稿箱
     * 
     * @param ids 需要删除的草稿箱主键
     * @return 结果
     */
    @Override
    public int deleteDraftBoxByIds(String[] ids)
    {
        return draftBoxMapper.deleteDraftBoxByIds(ids);
    }

    /**
     * 删除草稿箱信息
     * 
     * @param id 草稿箱主键
     * @return 结果
     */
    @Override
    public int deleteDraftBoxById(String id)
    {
        return draftBoxMapper.deleteDraftBoxById(id);
    }
}
